package com.football.springboot.service.impl;

import com.football.springboot.entity.Player;
import com.football.springboot.entity.PlayerAbility;
import com.football.springboot.entity.Team;
import com.football.springboot.mapper.PlayerMapper;
import com.football.springboot.service.IPlayerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 李越
 * @since 2023-02-24
 */
@Service
public class PlayerServiceImpl extends ServiceImpl<PlayerMapper, Player> implements IPlayerService {

    @Resource
    private PlayerMapper playerMapper;


    @Override
    public Team getTeaminfoByplayer(int id) {
        return playerMapper.getTeaminfoByplayer(id);
    }

    @Override
    public List<Player> listAllByIdPlayer() {
        return playerMapper.listAllByIdPlayer();
    }

    @Override
    public PlayerAbility getPlayerAbility(Integer playerId) {
        return playerMapper.getPlayerAbility(playerId);
    }

    @Override
    public List<Player> getPlayerByTeamId(Integer teamId) {
        return playerMapper.getPlayerByTeamId(teamId);
    }
}
